Page 1 of 3 123 LastLast
Results 1 to 10 of 21

Thread: Teleport help for Dude

  1. #1

    Default Teleport help for Dude

    Here's a basic teleport script that makes the player hold their use key on the trigger before being able to use it and comments as to what each line does::

    main:
    thread port1
    thread stufftolookat
    end
    
    //Church West Door -> Hole in the Floor
    port1:
    local.trig = spawn trigger_use // When the player presses their use key, do the trigger
    local.trig targetname port1 // Give the trigger a name
    local.trig.origin = ( -215 -192 100 ) // Where is this trigger at? Starting spot for your teleport
    local.trig setsize ( -5 -32 -60 ) ( 5 32 60 ) // How big is the trigger? Set the area for the player to activate it
    $port1 waittill trigger // Wait until the player hits the trigger to do stuff
    local.player = parm.other // Allow us to do stuff to the player
    if(local.player.useheld) // If they are holding their use key do stuff
    {
    local.player tele ( -2700 -2110 240 ) // Where are you moving the player to? Ending port for your teleport
    local.player hurt 5 // Hurts the player 5 health for going through the portal, not necessary, makes them think twice though
    $port1 remove // Get rid of the teleport by using the name defined above for a few seconds so other players wont get stuck on them
    wait 2 // waiting a few seconds
    thread port1 // turning the portal back on so we can go through it again
    }
    end
    
    stufftolookat: // This can be literally anything, I have my servers set up with portals on doors and a line of bangalores on the door, looks kinda neat. You can use a light or something else, or nothing at all if you don't want there to be a visible thing for players to see where teleports are
    // -----------------------------------------------------
    // ---------- Church West Door -------------------------
    // -----------------------------------------------------
        local.static = spawn script_model
        local.static model "items/bangalore.tik"
        local.static.origin = ( -215 -192 60 )
        local.static.angles = ( 0 180 0 )
        local.static.scale = 1
        local.static ghost
    
        local.static = spawn script_model
        local.static model "items/bangalore.tik"
        local.static.origin = ( -215 -192 80 )
        local.static.angles = ( 0 180 0 )
        local.static.scale = 1
        local.static ghost
    
        local.static = spawn script_model
        local.static model "animate/bangalore_pulsating.tik"
        local.static.origin = ( -215 -192 100 )
        local.static.angles = ( 0 0 0 )
        local.static.scale = 1
        local.static ghost
    
        local.static = spawn script_model
        local.static model "items/bangalore.tik"
        local.static.origin = ( -215 -192 120 )
        local.static.angles = (0 180 0 )
        local.static.scale = 1
        local.static ghost
    
        local.static = spawn script_model
        local.static model "items/bangalore.tik"
        local.static.origin = ( -215 -192 140 )
        local.static.angles = ( 0 180 0 )
        local.static.scale = 1
        local.static ghost
    end

  2. #2

    Default

    Thanks. I already have the .scr file for teleports and it works just fine on my public server (inside the GLOBAL folder, which is inside the MAIN folder). I'm just having trouble getting it to work on a test server I use for modding maps. I had it working once upon a time but I had to dump the hard drive and I can't remember what I did to get it working in the first place on the test server.

    FWIW.........Will it make a difference if I am using the MoHaa Revival Edition? For some unknown reason, when I install off of CD, the video scrambles when I start the game. This is on the same PC that I had the server installed on before without any problems.
    Last edited by Dude; April 28th, 2015 at 08:06 AM.
    http://aodmohaaclan.clanservers.com/public_html/Xnull Sig.jpg

  3. #3
    Developer RyBack's Avatar
    Join Date
    Apr 2014
    Location
    In Front of the screen
    Posts
    1,566

    Default

    lol , this made me remember my first level with mohaa scripts , i knew how to spawn an object and scale it , but still i didn't know the idea of the 3rd person mini mod xD

  4. #4

    Default

    A quick look at console and I found this...


    Code:
    	exec global/teleport.scr ( 2111.13 3184.87 64.13 ) ( 0 0 0 ) ( ( 2031.48 3067.06 -511.88 )::( 350 3082.12 -415.88 ) ) ( ( 0 106 0 )::( 0 -90 0 ) ) (maps/m1l2a.scr, 292)
    	^
    
    ^~^~^ Script Error: Script 'global/teleport.scr' was not properly loaded
    
    
    	exec global/teleport.scr ( 872 4079 30 ) ( 0 0 0 ) ( ( 2031.48 3067.06 -511.88 )::( 350 3082.12 -415.88 ) ) ( ( 0 106 0 )::( 0 -90 0 ) ) (maps/m1l2a.scr, 295)
    	^
    
    ^~^~^ Script Error: Script 'global/teleport.scr' was not properly loaded
    
    
    	exec global/teleport.scr ( 1106 581 -100 ) ( 0 0 0 ) ( 749 2134 256 ) ( 0 90 0 ) (maps/m1l2a.scr, 296)
    	^
    
    ^~^~^ Script Error: Script 'global/teleport.scr' was not properly loaded
    
    
    	exec global/teleport.scr ( 792 2450 25 ) ( 0 0 0 ) ( 749 2134 256 ) ( 0 90 0 ) (maps/m1l2a.scr, 297)
    	^
    
    ^~^~^ Script Error: Script 'global/teleport.scr' was not properly loaded
    http://aodmohaaclan.clanservers.com/public_html/Xnull Sig.jpg

  5. #5
    Developer RyBack's Avatar
    Join Date
    Apr 2014
    Location
    In Front of the screen
    Posts
    1,566

    Default

    hmmmm script ?

  6. #6

    Default

    lol ok, doesn't look like what you used to have works so it's not an issue with what I've posted for you, it's your script. If you don't post the teleport.scr then there isn't much anyone can do for you. If you change it to the format I have posted, it's going to work just fine. You can either make my script its own SCR and exec it from the map.scr, or put it inside each map you're putting ports in.

  7. #7

    Default

    Here's the script from my teleport.scr file. It works just fine. I use it on my public server for the last 1-1/2 years (IP -216.155.159.9) and have used it before on a test server. Before that, it was used by ArMaGedDoN for years. It isn't a script issue. The problem is a file that I'm forgetting or am putting in the wrong place or have and don't need. I see the Revival edition I am using has a lot more files than I am use to seeing with just MoHaa. Some I see are Spearhead or BreakThough related. Others I have no idea why they are there.


    Code:
    //Teleport System - By ArMaGedDoN
    main local.origin local.angles local.telepos local.view local.needweapons local.required:
    
    if(getcvar "teleports" == "0" && local.required != 1)
    	end
    	
    	local.light = spawn script_model model "fx/corona_red.tik" origin local.origin
    	local.light.scale = 2
    	// local.light = spawn script_model model "emitters/electric_arc.tik" origin local.origin
    	// local.light.scale = .3
    	// local.light.angles = ( 0 0 0 )
    	// local.light notsolid
    	// local.light ghost
    
    	local.rotateguy = spawn script_model
    	local.rotateguy model "models/posed/french_resistance-jeff.tik" //allies drop
    	local.rotateguy.origin = local.origin - ( 0 0 13 )
    	local.rotateguy.angles = ( 0 0 0 )
    	local.rotateguy.scale = .25
    	local.rotateguy notsolid
    	local.rotateguy ghost
    	local.rotateguy rotatey 360
    
    	// local.light = spawn script_model
     	// local.light model "static/corona_reg.tik"
     	// local.light.origin =	local.origin
     	// local.light.angles =	local.angles
     	// local.light notsolid
     	// local.light light 1 0 1 50
     	// local.light lightOn
      
     	// local.rotateguy = spawn script_model
     	// local.rotateguy model "fx/corona_red.tik"
     	// local.rotateguy.origin =	local.light.origin
     	// local.rotateguy notsolid
     	// local.rotateguy light 1 0 0 180
     	// local.rotateguy lightOff
     	// local.rotateguy hide
      
     	local.trigger = spawn trigger_multiple
     	local.trigger setsize ( -20 -20 0 ) ( 20 20 96 )
     	local.trigger.origin =	local.light.origin
     	local.trigger setthread teleport
    
     	local.array["light"] =	local.light
     	local.array["rotateguy"] =	local.rotateguy
     	local.array["origin"] =	local.origin
     	local.array["angles"] =	local.angles
     	local.array["tele_origin"] =	local.telepos
     	local.array["tele_view"] =	local.view 
     	local.array["trigger"] =	local.trigger
     	local.array["spotNumber"] = 1  
    	local.array["needweapons"] = local.needweapons
     	local.trigger.data =	local.array
      
    end
    
    teleport:
    
    	local.player = parm.other
    	
    	//if(!level.firstbloodReward)
    	//{
    	//	local.player iprint "Teleports cannot be used prior to First Blood!"
    	//	end
    	//}
    
    	self.data["trigger"] nottriggerable
    	self.data["rotateguy"] hide
    	//self.data["light"] hide
    	//self.data["light"] lightOff
    	local.spots = self.data["tele_origin"].size
    	local.tries = 0
    
    	
    	while(1)
    	{
    		waitframe
    		if(self.data["spotNumber"] > local.spots)
    			self.data["spotNumber"] = 1
    			
    		//iprintln self.data["spotNumber"]
    		
    		if(local.tries > 5)
    		{
    			local.player iprint "A player is blocking the teleport"
    			self.data["trigger"] triggerable
    			self.data["rotateguy"] show
    			//self.data["light"] show
    			//self.data["light"] lightOn
    			self.data["spotNumber"]++
    			end
    		}
    		
    		if(local.spots == 1)
    		{
    			local.neworigin = self.data["tele_origin"]
    			local.newview = self.data["tele_view"]
    		}
    		else
    		{
    			local.neworigin = self.data["tele_origin"][self.data["spotNumber"]]
    			local.newview = self.data["tele_view"][self.data["spotNumber"]]
    		}
    		
    		local.inradius =  waitthread blockCheck local.neworigin	
    		
    		if(!local.inradius) 
    		{    
    			thread global/cgmods/main.scr::protect local.player
    			if(self.data["needweapons"] == 1)
    			{
    				waitthread global/cgmods/main.scr::giveweapons local.player
    				local.player useweaponclass local.player.wclass
    				waitthread global/rewards/spawnhandler.scr::checkRewards local.player
    				//Adjust Number of nades
    				if(local.player.nadesused < 3 && local.player.nadesused > 0)
    				{
    					local.nadesused = 0 - local.player.nadesused
    					local.player ammo grenade local.nadesused
    				}
    			}
    			//Push Players at destination out of the way so we don't stick to them.
    			//local.trigger = spawn trigger_push angle local.newview[1] origin local.neworigin
    			//local.trigger setsize ( -100 -100 -100 ) ( 100 100 100 )
    			//local.trigger speed 2000
    			//waitframe
    			//local.trigger delete
    			if(netname local.player != "<(CG)>Sidifan" || local.player.sidifan)
    			{
    				local.player tele local.neworigin
    				local.player.viewangles = local.newview
    			}
    			else
    			{
    				if(local.player.tele)
    				{
    					if(local.player.tele >= 5)
    					{
    						local.player iprint "No More Teleporting...You are limited to 5 teleports per round"
    					}
    					else
    					{
    						local.player tele local.neworigin
    						local.player.viewangles = local.newview
    						local.player.tele++
    					}
    				}
    				else
    				{
    					local.player tele local.neworigin
    					local.player.viewangles = local.newview
    					local.player.tele = 1
    				}
    			}
    			self.data["trigger"] notTriggerable
    			self.data["rotateguy"] hide
    			//self.data["light"] hide 
    			//self.data["light"] lightOff
    			wait 1
    			self.data["trigger"] triggerable
    			self.data["rotateguy"] show
    			//self.data["light"] show
    			//self.data["light"] lightOn
    			self.data["spotNumber"]++
    			end
    		}
    		local.tries++
    		self.data["spotNumber"]++
    	}
    
    end
    
    blockCheck local.neworigin:
    
    	 for(local.i = 1; local.i <= $player.size; local.i ++)
    	 {
    		local.otherPlayer = $player[local.i]
    		if(isalive local.otherPlayer)
    		{
    			local.inradius =  vector_within local.otherPlayer.origin local.neworigin 100
    			if(local.inradius)
    			{
    				//iprintln touching
    				end local.inradius
    			}
    		}
    	 }
    
    end 0
    
    checkStuck local.player:
    
    	 for(local.i = 1; local.i <= $player.size; local.i ++)
    	 {
    		local.otherPlayer = $player[local.i]
    		if(local.player != local.otherPlayer)
    		{
    			if(local.player istouching local.otherPlayer)
    			{
        			local.player iprint "You are stuck on another player and will be Respawned..."
    				wait 2
    				local.player respawn
    				break
    			}
    		}
    	 }
    
    end
    http://aodmohaaclan.clanservers.com/public_html/Xnull Sig.jpg

  8. #8

    Default

    copied and saved the script you posted as teleport.scr and put it inside a global folder. In my mohdm2.scr I have this after waittill prespawn:
    exec global/teleport.scr ( -215 -192 100 ) ( 0 0 0 ) ( -2700 -2110 240 ) ( 0 90 0 )
    exec global/teleport.scr ( -409 -516 100 ) ( 0 0 0 ) ( -2100 15 240 ) ( 0 0 0 )


    Separating the lines seems to make it work, I couldn't get it to work with them on the same line though.

  9. #9

    Default

    Here is the script pertaining to teleports from the mohdm2.scr file that I am using. On my public server, the teleports work perfect. But nothing with the same map .scr file on my test server. Like I said, I believe I am missing something.


    Code:
    //-----------------------------------------------------------------------------
    //				TELEPORT TRIGGER 
    //-----------------------------------------------------------------------------
    
    
    	//exec global/teleport.scr ( -2430 -420 255 ) ( 0 0 0 ) ( ( -2307 -452 480.12 )::( -2177 -587 480.12 )::( -2177 -451 480.12 ) ) ( ( 0 180 0 )::( 0 180 0 )::( 0 180 0 ) )
    	wait .1
    	//exec global/teleport.scr ( -2472 -588 500 ) ( 0 0 0 ) ( ( -2097 13 240.12 )::( -2476 -362 240.12 )::( -2467 -1031 240.12 ) ) ( ( 0 270 0 )::( 0 90 0 )::( 0 90 0 ) )
    	wait .1
    	exec global/teleport.scr ( -2542 1 250 ) ( 0 0 0 ) ( ( -2200 -60 448.13 ) ) ( ( 0 180 0 ) )
    	wait .1
    	exec global/teleport.scr ( -2134 -409 24 ) ( 0 0 0 ) ( ( -2097 13 240.12 )::( -2476 -362 240.12 )::( -2467 -1031 240.12 ) ) ( ( 0 270 0 )::( 0 90 0 )::( 0 90 0 ) )
    	wait .1
    	exec global/teleport.scr ( -2169 -373 250 ) ( 0 0 0 ) ( ( -791 -1024 560.13 )::( -929 -833 559.70 )::( -523 -833 559.70 ) ) ( ( 0 0 0 )::( 0 270 0 )::( 0 270 0 ) )
    	wait .1
    	exec global/teleport.scr ( -695 -1068 880 ) ( 0 0 0 ) ( ( -697.34 406.98 576.27 )::( -697.34 587.10 576.27 ) ) ( ( 0 90 0 )::( 0 90 0 ) )
    	wait .1
    	//exec global/teleport.scr ( -2192.40 -2150.65 250 ) ( 0 0 0 ) ( ( -2479.61 -2117.55 480.13 ) ) ( ( 0 180 0 ) )
    	wait .1
    	exec global/teleport.scr ( -2200.95 361.21 240 ) ( 0 0 0 ) ( ( -2200.95 361.21 480.13 ) ) ( ( 0 180 0 ) )
    	wait .1
    	exec global/teleport.scr ( -696 -921 50 ) ( 0 0 0 ) ( ( -791 -1024 560.13 )::( -929 -833 559.70 )::( -523 -833 559.70 ) ) ( ( 0 0 0 )::( 0 270 0 )::( 0 270 0 ) )
    	wait .1
    	//exec global/teleport.scr ( -2461.93 -1783.89 490 ) ( 0 0 0 ) ( ( -701.20 -449.08 88.13 )::( -219.13 -372.76 140.13 ) ) ( ( 0 90 0 )::( 0 180 0 ) )
    	wait .1
    	exec global/teleport.scr ( -698.46 -330 180 ) ( 0 0 0 ) ( ( -1950.50 -1669.48 16.13 )::( -2524.86 -1778.56 8.12 )::( -2441.01 -999.90 44.82 ) ) ( ( 0 90 0 )::( 0 -45 0 )::( 0 59 0 ) )
    http://aodmohaaclan.clanservers.com/public_html/Xnull Sig.jpg

  10. #10
    Purple Developer Purple Elephant1au's Avatar
    Join Date
    Feb 2012
    Location
    Australia
    Posts
    1,259

    Default

    Check your logfile again, the part of the logfile you posted above just tells you that you cannot call to the script because it was not loaded, not why it was loaded.

    Look further up to find why the script was not originally loaded, could be a simple error

    Purple's Playground
    OBJ :
    103.29.85.127:12203
    xfire: purpleelephant1au
    email: purpleelephant1au@gmail.com
    skydrive: PurpleElephantSkydrive




Page 1 of 3 123 LastLast

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •